package com.his.service;

import com.his.commons.core.dto.PageInfo;
import com.his.commons.core.exception.HisException;
import com.his.controller.form.ModifyUserForm;
import com.his.controller.form.NewUserForm;
import com.his.controller.form.ObtainOneUserForm;
import com.his.controller.info.LoginUserInfo;
import com.his.controller.info.UserAllInfo;
import com.his.controller.info.UserByDayInfo;
import com.his.controller.info.UserByIdsInfo;
import com.his.model.UserInfo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 梅津铧
 * @since 2022-03-22
 */
public interface UserInfoService extends IService<UserInfo> {

    /**
     * 注册员工
     * @param newUserForm
     */
    boolean increaseUser(NewUserForm newUserForm) throws HisException;

    /**
     * 修改权限
     * @param newUserForm
     */
    boolean modifyUser(ModifyUserForm newUserForm) throws HisException;

    /**
     * 获取当前登录员工的信息
     * @param userJobNum  员工工号
     * @return  当前登录员工的信息
     */
    LoginUserInfo obtainUserInfo(Integer userJobNum) throws HisException;

    /**
     * 根据工号或姓名模糊查询
     * @param obtainInfo  查询条件
     * @return 员工信息
     */
    List<UserAllInfo> obtainByInfo(String obtainInfo) throws HisException;

    /**
     * 获取某页员工信息
     * @param pagenum  页码
     * @param pagesize  每页数据量
     * @return  员工信息
     */
    PageInfo<UserAllInfo> obtainByPage(Integer pagenum, Integer pagesize) throws HisException;

    /**
     * 根据科室、诊室获取员工信息
     * @param userDepartment  科室名称
     * @param userDisagnosisRoom  诊室名称
     * @return  员工信息
     */
    UserByIdsInfo obtainByNames(String userDepartment, String userDisagnosisRoom) throws HisException;

    /**
     * 注销员工
     * @param userJobNum 注销员工的工号
     */
    boolean logoutUser(Integer userJobNum) throws HisException;

    /**
     * 批量注销员工
     * @param userJobNums  注销的员工工号
     */
    boolean logoutUsers(List<Integer> userJobNums) throws HisException;

    /**
     * 员工登录
     * @param userJobNum  员工工号
     * @param userPassword  登录密码
     * @return  员工信息
     */
    UserAllInfo loginUser(Integer userJobNum, String userPassword) throws HisException;

    /**
     * 批量获取员工信息
     * @param userJobNums 员工工号
     * @return 员工信息
     */
    List<UserByDayInfo> obtainUsers(List<Integer> userJobNums) throws HisException;
}
